import requests
from bs4 import BeautifulSoup

page = requests.get("http://sh.ganji.com/fang1/2899598807x.htm")
response = page.content
soup = BeautifulSoup(page.content)

# 存储的明细数据
stroreDetail = {}

# 标题
title = soup.title.string
addressPath = {}
# 文章的具体位置
locations = soup.find_all("div", class_="f-crumbs f-w1190")
if locations:
    all_location_items = locations[0].find_all("a")
    if all_location_items:
        start = 0
        for item in all_location_items:
            addressPath[start] = {"href": item.get("href"), "val": str(item.next)}
            start = start + 1

stroreDetail["addressPath"] = addressPath
stroreDetail["title"] = title

# 查看数量
browseCount = soup.find(attrs={"class": "date"})
if browseCount:
    browseCount = browseCount.next
    stroreDetail["days"] = browseCount

# 户型
huxing = soup.find_all("ul", class_="er-list f-clear")

# 面积
# 朝向
# 楼层
# 电梯情况
# 装修情况
# 小区名称
# 地铁
# 所在地址


# 房屋配套

# 房屋描述

# 地图

# 小区信息
zx


# 经纪人

# https://cuiqingcai.com/1319.html


# print(soup)
